<%@tag import="java.math.BigDecimal"%>
<%@tag import="java.text.DecimalFormat"%>
<%@ tag pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ attribute name="num" required="true" rtexprvalue="true" description="要格式化的数字"%>
<%@ attribute name="format" required="true" rtexprvalue="true" description="格式"%>
<%@ attribute name="type" required="true" rtexprvalue="true" description="格式类型"%>
<%String result = "";
	// 1 全部数量  2 整数部分  3 小数部分
	StringBuffer tmpBuf = new StringBuffer();
	DecimalFormat df = new DecimalFormat("0.00");
	String tmpNum = df.format(new BigDecimal(num));
	if("1".equals(type)){
		result = tmpNum;
	}else if ("2".equals(type)){
		result = tmpNum.substring(0,tmpNum.indexOf("."));
	}else if("3".equals(type)){
		result = tmpNum.substring(tmpNum.indexOf("."));
	}
%><%=result%>